package com.gzhryc.shared_device.oem.h5.agent.mng.dto.place;

import java.util.List;

public class PlaceUser {

    private Long userId;
    private String userName;
    private String userPhone;
    private Integer roleType;
    private String roleTypeName;
    private String note;
    private Boolean canUpdate = true;

    private List<IncomeRatioItem> incomeRatioItems;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public Integer getRoleType() {
        return roleType;
    }

    public void setRoleType(Integer roleType) {
        this.roleType = roleType;
    }

    public String getRoleTypeName() {
        return roleTypeName;
    }

    public void setRoleTypeName(String roleTypeName) {
        this.roleTypeName = roleTypeName;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Boolean getCanUpdate() {
        return canUpdate;
    }

    public void setCanUpdate(Boolean canUpdate) {
        this.canUpdate = canUpdate;
    }

    public List<IncomeRatioItem> getIncomeRatioItems() {
        return incomeRatioItems;
    }

    public void setIncomeRatioItems(List<IncomeRatioItem> incomeRatioItems) {
        this.incomeRatioItems = incomeRatioItems;
    }

    public String getIncomeRatioNote(){
        if(this.incomeRatioItems != null && this.incomeRatioItems.size() > 0){
            String temp = "";
            for(IncomeRatioItem incomeRatioItem : this.incomeRatioItems){
                temp = "," + incomeRatioItem.getBusinessTypeName() + "("+incomeRatioItem.getIncomeRatio()+"%)";
            }
            return temp.substring(1);
        }
        return "--";
    }

    public static class IncomeRatioItem {

        private String businessType;
        private String businessTypeName;
        private Double incomeRatio;

        public String getBusinessType() {
            return businessType;
        }

        public void setBusinessType(String businessType) {
            this.businessType = businessType;
        }

        public String getBusinessTypeName() {
            return businessTypeName;
        }

        public void setBusinessTypeName(String businessTypeName) {
            this.businessTypeName = businessTypeName;
        }

        public Double getIncomeRatio() {
            return incomeRatio;
        }

        public void setIncomeRatio(Double incomeRatio) {
            this.incomeRatio = incomeRatio;
        }
    }
}
